import Vue from 'vue'

// 引入语言包
import elementZH from 'element-ui/lib/locale/lang/zh-CN'
import elementEN from 'element-ui/lib/locale/lang/en'
import menusZH from './zh'
import menusEN from './en'
// 演示国际化插件的引入
// 引入库
import VueI18n from 'vue-i18n'
// 注册库
Vue.use(VueI18n)
// 创建实例
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早安！',
      goodDay: '祝你开心每一天！',
      ...elementZH,
      ...menusZH
    },

    en: {
      morning: 'Good Morning！',
      goodDay: 'Have a good day!',
      ...elementEN,
      ...menusEN
    }

  }
})
